<?php

/**
 * 辅助模块
 *
 * Created by PhpStorm.
 * User: evan
 * Date: 2016/10/29
 * Time: 下午5:08
 */
class Helper extends MY_Api_Controller
{
    /**
     * 反馈聊天房间号
     */
    public function feedback_chat_room_num()
    {
        $ds_id = (int)$this->input->get_post('ds_id');
        $chat_room_num = trim($this->input->get_post('chat_room_num'));


        $this->load->service('direct_seeding/service_direct_seeding_helper');
        $data = $this->service_direct_seeding_helper->feedback_chat_room_num($ds_id, $chat_room_num);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 获取房间用户
     */
    public function get_room_number()
    {
        $ds_id = (int)$this->input->get_post('ds_id');
        $offset  = (int)$this->input->get_post('offset');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('direct_seeding/service_direct_seeding_helper');
        $data = $this->service_direct_seeding_helper->get_room_number($ds_id, $offset, $limit);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 获取单场直播观看人数
     */
    public function get_watch_number()
    {
        $ds_id = (int)$this->input->get_post('ds_id');


        $this->load->service('direct_seeding/service_direct_seeding_helper');
        $data = $this->service_direct_seeding_helper->get_watch_number($ds_id);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 直播点赞
     */
    public function like()
    {
        $uid   = $this->uid;
        $ds_id = (int)$this->input->get_post('ds_id');


        $this->load->service('direct_seeding/service_direct_seeding_helper');
        $data = $this->service_direct_seeding_helper->like($uid, $ds_id);


        $this->json_output($data['data'], $data['status']);
    }
}